<script>

export default {
  created() {
    // 调用API从本地缓存中获取数据
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)
    console.log('app created and cache logs by setStorageSync')
  },
  mounted() {
    this.fontLoad();
  },
  methods: {
    //引入字体
    fontLoad() {
      wx.loadFontFace({
        family: 'HYChengXingJ',
        source: 'url("/static/font/HYChengXingJ.ttf")',
        success: function (res) {
          console.log(res.status) //  loaded
        },
        fail: function (res) {
          console.log(res.status) //  error
        },
        complete: function (res) {
          console.log(res.status);
        }
      })
    },
  },
}
</script>
<style lang="less">
/* this rule will be remove */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-size: 16px;
  .container {
    width: 100%;
    height: 100%;
  }
  .HYChengXingJ {
    font-family: "HYChengXingJ";
  }
}
</style>

